In machining by a machine tool, the machining accuracy is, in many cases, checked by shape measurement of a work after the machining. For example, in a case where a work is transferred from a machine tool onto a measuring instrument to perform shape measurement, when it is determined that additional machining is necessary as a result of the measurement, the work is returned from the measuring instrument to the machine tool. If required setup to be performed again such as the positioning of the work in the machine tool is complicated, a great amount of effort is required in order to reproduce the installation accuracy of the work. Alternatively, in most of the cases where shape measurement is performed on a machine tool, for example, a contact-type measuring element attached to a spindle of the machine tool is used for a fixed work. In such a case, as the shape of the work becomes more complicated, greater amounts of effort and time are required for the creation of a measurement program or for manual measurement. Also in a case of a die sinking electric discharge machining apparatus, similar problems occur in shape measurement on the machine. Particularly, as the shape of a work becomes more complicated, it becomes more difficult to perform measurement to create a program for additional machining or to calculate a difference between the target shape and the measured shape. For example, in Patent Literature 1, a technique for automatically measuring the position of a concave portion formed in a work has been proposed. In such a technique, a measuring operation such that a measuring element is brought into contact with a surface of the work on which the concave portion is formed with a predetermined pitch and the measuring element is moved in a depth direction of the concave portion at the central portion of the concave portion is performed.